<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>利用浮动实现水平菜单</title>
		<style type="text/css">
			ul
			{
				float:left;
				margin:0px;
				padding:0px;
				width: 100%;
				list-style-type: none;
			}
			li a{
				float: left;
				text-decoration: none;
				padding:0.2em 0.6em;
				width:7em;
				color:white;
				background-color: purple;
				border-right: 1px solid white;
			}
			li{
				display:inline;
			}
			a:hover
			{
				background-color: red;
			}
		</style>
	</head>
	<body>
		<ul id = "total">
			<li><a href = "#">left1</a></li>
			<li><a href = "#">left2</a></li>
			<li><a href = "#">left3</a></li>
			<li><a href = "#">left4</a></li>
		</ul>
	</body>
</html>